package basic.study.algorithms.struct.LRUCache;

import java.util.LinkedHashMap;
import java.util.Map;

public class LRUCache2 {
    public static void main(String[] args) {
        final int cacheSize = 100;
        Map<String, String> map = new LinkedHashMap<String, String>((int)
        Math.ceil(cacheSize / 0.75f)+1, 0.75f, true) {
            @Override
            protected boolean removeEldestEntry(Map.Entry<String, String> eldest) {
//                return super.removeEldestEntry(eldest);
                return size() > cacheSize;
            }
        };
        //map即是实现了的LRU
    }
}
